
<template>
        <Table border :columns="columns" :data="tableData"></Table>
</template>

<script>

export default {
    props: {
        tableData: Array
    },
    data () {
        return {

            columns: [
                {
                    title: '序号',
                    type: 'index',
                    width: 80,
                    align: 'center'
                },
                {
                    title: '操作对象',
                    align: 'center',
                    key: 'functionname',
                    editable: true
                },
                {
                    title: '操作内容',
                    key: 'action',
                    width: 200,
                    align: 'center',
                    render: (h, params) => {
                        return h('div', [
                            h(
                                'Button',
                                {
                                    props: {
                                        type: 'primary',
                                        size: 'small'
                                    },
                                    /* style: {
                                        marginRight: "5px"
                                    }, */
                                    style: {
					                	display: 'inline-block',
					                	width: '50%',
					                	overflow: 'hidden',
					                	textOverflow: 'ellipsis',
					                	whiteSpace: 'nowrap'
                                    },
                                    on: {
                                        click: () => {
                                            this.queryData(params.index)
                                        }
                                    }
                                },
                                '数据内容'
                            )
                        ])
                    }
                },
                {
                    title: '操作状态',
                    align: 'center',
                    key: 'statusName',
                    editable: true
                },
                {
                    title: '操作时间',
                    align: 'center',
                    key: 'operatortime',
                    editable: true
                },
                {
                    title: '操作人',
                    align: 'center',
                    key: 'operatorname',
                    editable: true
                }
            ],
            data: []
        }
    },

    methods: {
        init () {

        },
        queryData (index) {
            this.$Modal.info({
                title: '数据内容',
                content: `操作前的数据：${this.tableData[index].beforeoperational}<br><br>操作后的数据：${this.tableData[index].afteroperation}`
            })
        }
    },
    created () {
    // this.init();
    }
}
</script>
